#include <iostream>
#include <string.h>
#include <list>
#include <list>
// 需在QT运行
using namespace std;

void abc()
{
    int q;
}

class test
{
public:
    bool operator()(int x, int y)
    {
        return x > y;
    }
};
//===========================================================
class a // LAMBDA表达式在类中使用
{
private:
    int x = 10;

public:
    void print()
    {
        // 定义一个LAMBDA表达式
        auto func = [this]()
        {
            cout << this->x << endl;
        };
        // 使用LAMBDA表达式
        func();
    }
};

int main()
{
    a a1;
    a1.print();
    cout << "===================================" << endl;
    list<int> l1;
    l1.push_back(10);
    l1.push_back(6);
    l1.push_back(8);

    auto ttt = [](int x, int y)
    { return x > y; };
    l1.sort(ttt);
    //    l1.sort([](int x , int y){return x>y;});

    for (list<int>::iterator it = l1.begin(); it != l1.end(); it++)
    {
        cout << *it << endl;
    }
    return 0;
}
